﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;
using System.ComponentModel.DataAnnotations.Schema;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——临时产品序列号
    /// </summary>
    [Serializable]
    [Description("临时产品序列号")]
    public class SerialNumTemp :  EntityBase,ICreatedTime, IAudited
    {
        /// <summary>
        ///入库方式
        /// </summary>
        [Display(Name = "入库方式")]
        public virtual InStoreType InStoreType { get; set; }
        /// <summary>
        ///入库方式外键
        /// </summary>
        [Display(Name = "入库方式外键")]
        public long InStoreTypeId { get; set; }

        /// <summary>
        ///出/入库单号
        /// </summary>
        [Display(Name = "出/入库单号")]
        [Required]
        public long InStoreId { get; set; }

        /// <summary>
        ///采购退货单外键
        /// </summary>
        [Display(Name = "采购退货单外键")]
        public long? InBuyBackId { get; set; }

        /// <summary>
        ///销售退货单外键
        /// </summary>
        [Display(Name = "销售退货单外键")]
        public long? OutSellBackId { get; set; }

        /// <summary>
        ///仓库
        /// </summary>
        [Display(Name = "仓库")]
        public virtual Warehouse Warehouse { get; set; }
        /// <summary>
        ///仓库外键
        /// </summary>
        [Display(Name = "仓库外键")]
        public long WarehouseId { get; set; }

        /// <summary>
        ///产品
        /// </summary>
        [Display(Name = "产品")]
        public virtual Product Product { get; set; }
        /// <summary>
        ///产品外键
        /// </summary>
        [Display(Name = "产品外键")]
        public long ProductId { get; set; }

        /// <summary>
        ///序列号
        /// </summary>
        [Display(Name = "序列号")]
        [Required, StringLength(50)]
        public string SerialNumber { get; set; }

        /// <summary>
        ///生产日期
        /// </summary>
        [Display(Name = "生产日期")]
        public DateTime? BirthDay { get; set; }

        /// <summary>
        ///生产批次
        /// </summary>
        [Display(Name = "生产批次")]
        [StringLength(50)]
        public string Batch { get; set; }

        /// <summary>
        ///过期日期
        /// </summary>
        [Display(Name = "过期日期")]
        public DateTime? OverdueDay { get; set; }

        /// <summary>
        ///状态 0等待审核入库 1审核入库 3等待审核采购退货 4审核采购退货 5等待审核出库 6审核出库 7等待审核客户退货 8审核客户退货 9上机销售 10售罄
        /// </summary>
        [Display(Name = "状态")]
        public int Status { get; set; }

        /// <summary>
        /// 序列号类别 0普通商品 1油 2售油机
        /// </summary>
        public int SerialNumType { get; set; }
        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion
    }
}
